const arrToMap = <T extends Object>(list: T[], key: keyof T) => {
	return list.reduce((map: {[k: string]: T}, item) => {
		const val = item[key] as unknown as string;
		map[val] = item;
		return map;
	}, {});
};

export const USER_ORDER_STATUS_LIST = [
	{
		id: 0,
		label: '待支付'
	},
	{
		id: 1,
		label: '待预约'
	},
	{
		id: 2,
		label: '待接单'
	},
	{
		id: 3,
		label: '待服务'
	},
	{
		id: 4,
		label: '服务中'
	},
	{
		id: 5,
		label: '已完成'
	},
	{
		id: 6,
		label: '已取消'
	},
];

export const USER_ORDER_STATUS_MAP = arrToMap(USER_ORDER_STATUS_LIST, "id");

export const SERVICE_PHONE_NUMBER = "19042566932";